home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
tsrhelp.zip
/
SAVESCR.INC
< prev
next >
Wrap
Text File
|
1992-05-24
|
2KB
|
68 lines
;---------------------------------------------------------------------------
; Program: SaveScr.Asm
;
; Author: Steve Poulsen
;
; This procedure will save the screen text/attr at SI with the size to save
; entered in CX and DX with CL = X1, CH = Y1, DL = X2, DH = Y2. SI should
; point to a location with the same number of words as characters to save.
;
;---------------------------------------------------------------------------
SaveScr Proc Near
Push AX
Push BX
Push DI
Push SI
Push CX
Push ES
Mov AX,0B800h ; Screen memory segment for color
Mov ES,AX
Mov AH,0Fh ; Check video mode
Int 10h
Cmp AL,07h ; Monochrome?
JNE Clr2
Mov AX,0B000h ; Screen memory segment for mono
Mov ES,AX
Clr2:
Mov BL,CL
Mov BH,0
Mov AL,160
Mul CH
Mov DI,AX
Add DI,BX
Add DI,BX
C2:
Push DX
Mov DX,ES:[DI]
Mov CS:[SI],DX
Pop DX
Cmp BL,DL
JE N2
Inc DI
Inc DI
Inc SI
Inc SI
Inc BL
Jmp C2
N2: ; Start of loop for vert. lines
Inc DI
Inc DI
Inc SI
Inc SI
Inc BL
Inc CH
Cmp CH,DH
JLE Clr2
Pop ES
Pop CX
Pop SI
Pop DI
Pop BX
Pop AX
Ret
SaveScr EndP